
export const useAppStore = defineStore('app', {
  state: () => {
    return {
      title: '',
      max: false,
      dark: localStorage.getItem('dark') === 'true' 
    }
  },
  getters: {
    getTitle: (state) => state.title,
    getMax: (state) => state.max,
    getDark: (state) => state.dark,
  },
  actions: {
    setTitle(title) {
      this.title = title
    },
    setMax(max) {
      this.max = max
    },
    setDark(dark){
      this.dark = dark;
      localStorage.setItem('dark', dark + '')
    }
  }
})